<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddRepayTypeToRepayRecordCommon extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('repay_record_commons', function (Blueprint $table) {
            $table->unsignedTinyInteger('repay_type')->default(1)->comment('1=>app中用户手动点击还款,2=>app中自动还款')->after('status_time');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        if(Schema::hasTable('repay_record_commons')){
            Schema::table('repay_record_commons', function (Blueprint $table) {
                $table->dropColumn('repay_type');
            });
        }
    }
}
